package sopa.java.misc;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ShowProperties
{
    
    public Properties retrieveResources(String path) throws IOException
    {
        final InputStream is = getClass().getResourceAsStream(path);
        Properties props = new Properties();
        props.load(is);
        return props;
    }
    
    /**
     * @param args
     * @throws IOException 
     */
    public static void main(String[] args) throws IOException
    {
        System.getProperties().list(System.out);
        System.out.println(System.getProperty("user.name"));
        System.out.println(System.getProperty("java.library.path"));
        
        System.out.println("Properties from file ----------");
        Properties props = new ShowProperties().retrieveResources("/application.properties");
        props.list(System.out);
    }
}
